<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <div>{{msg}}</div>
    <div>{{reverseString()}}</div>
  </div>
  <script type="text/javascript" src="js/vue.js"></script>
  <script type="text/javascript">
    /*
      计算属性
    */
    var vm = new Vue({
      el: '#app',
      data: {
        msg: 'Nihao'
      },
      // computed: {
      //   reverseString: function () {
      //     return this.msg.split('').reverse().join('');
      //   }
      // },
      methods: {
        reverseString() {
          return this.msg.split('').reverse().join('');
        }
      }
    });
  </script>
</body>

</html>